package com.example.personblog.interceptor;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.HandlerInterceptor;

import java.io.IOException;

//登录拦截器,必须实现接口HandlerInterceptor(有拦截器的三个常用方法),然后重写方法
public class Logininterceptor implements HandlerInterceptor {
    @Override
    //传过来三个参数,比较重要的是request对应前端发来的请求, response是为前端返回对应的信息,
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handle) throws IOException {
        System.out.println("LoginInterceptor");
        return true;
    }
}
    //做完这个拦截器还要做配置,springboot里配置一般在config包下
